package com.common.entity.sbxBase;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.common.validations.RequiredField;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.util.List;


@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@TableName("route")
public class Route implements Serializable {

    @TableId(type = IdType.ASSIGN_UUID)
    @ApiModelProperty("路由id")
    private String id;

    @TableField("name")
    @ApiModelProperty("路由名称")
    @NotEmpty(message = "路由名称不能为空", groups = RequiredField.class)
    private String name;

    @TableField("path")
    @ApiModelProperty("路由名称")
    @NotEmpty(message = "路由名称不能为空", groups = RequiredField.class)
    private String path;

    @ApiModelProperty("路由元数据")
    @NotEmpty(message = "路由元数据不能为空", groups = RequiredField.class)
    private String meta;

    @ApiModelProperty("组件路由")
    @NotEmpty(message = "组件路由不能为空", groups = RequiredField.class)
    private String component;

    @ApiModelProperty("父id")
    @NotEmpty(message = "父id不能为空", groups = RequiredField.class)
    private String parentId;

    @ApiModelProperty(value = "是否隐藏 是,否")
    @NotEmpty(message = "是否隐藏", groups = RequiredField.class)
    private boolean hidden;

    @ApiModelProperty(value = "类型")
//    @NotEmpty(message = "类型",groups = UserSave.class)
    private String type;

    @ApiModelProperty(value = "角色Id")
    private String roleId;

    @TableField(exist = false)
    @ApiModelProperty("子类对象")
    private List<Route> children;


}
